<%--
  Created by IntelliJ IDEA.
  User: 001
  Date: 2021/9/4
  Time: 21:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>新笔趣阁_管理员界面</title>
    <link rel="stylesheet" href="./css/admin.css">
    <script src="http://code.jquery.com/jquery-1.12.4.min.js"></script>
    <script type="text/javascript" src="js/jquery-1.12.4.js"></script>
    <script type="text/javascript" src="js/login.js"></script>
    <link rel="stylesheet" type="text/css" href="css/login-ajax.css">
    <script type="text/javascript" src="./js/clipboard.min.js"></script>
</head>
<script>
    $(function () {
        $(".delete").click(function () {
            var arr = new Array();
            arr = $(this).prop("id").split('&');
            var name = arr[1];
            $.ajax({
                url: "http://localhost:8080/mutilBook",
                type: "post",
                data: {
                    "b_name": name,
                    "_method": "deleteBook1"
                },
                success:function (result){
                    alert("删除成功")
                }
            })
            $(this).parent().parent().remove();

        })
    })

</script>
<body>
<!-- 头部开始 -->
<header class="header">
    <!-- 头部的div用来保证缩放可以正常进行 -->
    <div class="center">
        <div class="header-div">
            <div class="header-left-one">
                <!-- <img src="./images/all.gif" alt=""> -->
                <a class="btnCopy" data-clipboard-text="localhost:8080">将本站设为首页</a>
            </div>
            <div class="header-left-two">
                <a href="#">收藏新笔趣阁</a>
            </div>
            <div class="header-right">
                <c:if test="${empty username}">
                    <form action="/mutilAdmin" class="header-form" id="loginForm">
                        账号：<input type="text" name="username" id="username" class="username">
                        密码：<input type="password" name="password" id="password" class="password">
                        <input type="button" value="登录" id="submit">
                        <a href="register.jsp" class="registration">用户注册</a>
                        <a href="forgetpwd.jsp" class="registration">忘记密码</a>
                    </form>
                </c:if>
                <c:if test="${not empty username}">
                    <span id="ajax">hi,${username}&ensp;
                        <c:if test="${type==3}">超级管理员
                            <a href="/mutilAdmin?_method=selectAdmin" class="svip">超级管理员界面&ensp;|</a>
                        </c:if>
                        <c:if test="${type==2}">管理员
                            <a href="/mutilAdmin?_method=selectAdmin" class="vip">管理员界面&ensp;|</a>
                        </c:if>
                        <c:if test="${type==1}">尊敬的用户
                            <a href='/index.jsp' class='user'>回到首页&ensp;|</a>
                        </c:if>
                    </span>
                    <a href="/BookShelf?_method=myBookShelf">我的书架&ensp;|</a>
                    <a href="forgetpwd.jsp">修改密码&ensp;|</a>
                    <a class="exit">安全退出&ensp;|</a>
                </c:if>

            </div>
            <div class="clear"></div>
        </div>
    </div>
</header>
<!-- --------------------头部结束/整体开始 ----------------------->
<!-- 新笔趣阁图标一栏 -->
<div class="new-penguin center">
    <div id="new-penguin-div">
        <div class="image"><a href="index.jsp"><img src="../images/图标.jpg" alt=""></a></div>
        <div class="form-div">
            <form action="/mutilBook" class="form">
                <input type="search" class="search-box" name="b_name" placeholder="输入需要搜索的内容">
                <input type="hidden" name="_method" value="searchBook">
                <input type="submit" value="搜索" class="submit-search">
            </form>
        </div>
        <div class="clear"></div>
    </div>
</div>
<!-- 标题 -->
<div class="title center">
    <div class="title-div">
        <!-- <a href="#">首页</a>
                <a href="#">永久书架</a>
                <a href="#">玄幻奇幻</a>
                <a href="#">武侠仙侠</a>
                <a href="#">都市言情</a>
                <a href="#">历史军事</a>
                <a href="#">科幻灵异</a>
                <a href="#">网游竞技</a>
                <a href="#">女频频道</a>
                <a href="#">完本小说</a>
                <a href="#">排行榜单</a>
                <a href="#">临时书架</a> -->
        <ul>
            <li><a href="mutilAdmin?_method=selectUser">用户管理</a></li>
            <li><a href="mutilBook?_method=selectBook">书籍管理</a></li>
            <li><a href="mutilAdmin?_method=selectAdmin">管理员管理</a></li>
            <li><a href="chapterman.jsp">章节管理</a></li>
            <li><a href="index.jsp">新笔趣阁</a></li>
        </ul>
    </div>
    <div class="clear"></div>
</div>
<!-- 标题结束 -->
<!-- 主体部分 -->
<div class="center">
    <!-- <div>
                <div><p>小说排行列表</p></div>
            </div> -->
    <div>
        <table>
            <div class="m_fir">
                <h3>书籍相关</h3>
                <a href="addbook.jsp">
                    <input type="submit" value="增加">
                </a>
            </div>
            <tr>
                <th>序号</th>
                <th>书籍名称</th>
                <th>书籍作者</th>
                <th>图片路径</th>
                <th>浏览人数</th>
                <th>书籍类型</th>
                <th style="width: 120px">最后更新时间</th>
                <th style="text-align: center;">操作</th>
            </tr>
            <c:forEach items="${book}" var="b">
                <tr>
                    <td>${b.b_id}</td>
                    <td>${b.b_name}</td>
                    <td>${b.b_author}</td>
                    <td>${b.b_image}</td>
                    <td>${b.b_count}</td>
                    <td>${categorymap[b]}</td>
                    <td>${b.b_last_update_time}</td>
                    <td style="text-align: center;"><a href="mutilBook?_method=qurryBook&b_name=${b.b_name}">修改</a>&nbsp;
                        <a  class="delete" id="delete&${b.b_name}">删除</a></td>
                </tr>
            </c:forEach>

        </table>
    </div>
</div>
</body>
<script src="./js/jquery-1.12.4.js"></script>
<script>
    $(function () {
        $(".search-box").focus(function () {
            $(this).attr("placeholder", "");
        })
        $(".search-box").blur(function () {
            $(this).attr("placeholder", "输入需要搜索的内容");
        })
    })
</script>

</html>
